# -*- coding: utf-8 -*-
#!/usr/bin/env python

import imp
import logging
import configs.configs as conf
from wsgiref.simple_server import make_server

if __name__ == '__main__':
    logging.basicConfig(filename='voda_services.log', level=logging.INFO)
    conf.set_host_port()
    app = imp.load_source('setup', 'server/setup.py')
    application = app.setup_server(conf.mongo_host, conf.mongo_port)
    logging.info('Starting WSGYeSrver type %s on %s:%d ... ' % ("wsgiref", conf.cherrypy_host, conf.cherrypy_port))
    make_server(conf.cherrypy_host, conf.cherrypy_port, application).serve_forever()